package com.yanwq.pulltorefreshview.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;

/**
 * 作者：yanweiqiang。
 * 日期：2016/8/1 0001。
 */
public class PullToRefreshScrollView extends ScrollView implements ScrollDetector {
    public PullToRefreshScrollView(Context context) {
        super(context);
    }

    public PullToRefreshScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public PullToRefreshScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean theTop() {
        return getScrollY() == 0;
    }

    @Override
    public boolean theEnd() {
        View contentView = getChildAt(0);
        return contentView.getMeasuredHeight() <= getScrollY() + getHeight();
    }

    @Override
    public void setTheEndCallback(TheEndCallback callback) {

    }
}
